// <copyright file="ColumnDragDrop.aspx.cs" company="YUIAsp.Net">
// Copyright (c) 2009 All Right Reserved
// </copyright>
// <author>raul popescu</author>
// <email>dev@yuiasp.net</email>
// <date>2009-01-30</date>
// <summary>YUIAsp.Net File</summary>

using System;
using YUIAspNet;

namespace YUIAspNetDemo.DataTable
{
    public partial class ColumnDragDrop : BaseDemoPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            LocalDataSource data = new LocalDataSource();

            data.AddColumn("DatePaid");
            data.AddColumn("Amount");
            data.AddColumn("PaidTo");
            data.AddColumn("Remaining");

            data.AddRow(new DateTime(2000, 01, 01), "250", "gogu@google.com", 10000.3);
            data.AddRow(new DateTime(2000, 02, 01), "500", "mail@yahoo.com", 16000.3);
            data.AddRow(new DateTime(2000, 03, 01), "600", "some@one.com", 10800.23254);
            data.AddRow(new DateTime(2000, 04, 01), "800", "foo@bar.com", 10000);

            this.dt.Source = data;

            this.dt.Columns[0].TemplateFormat = new DateFormat { Format = "%m %Y" };
            this.dt.Columns[1].TemplateFormat = new CurrencyFormat { Prefix = "$", DecimalPlaces = 1 };
            this.dt.Columns[2].TemplateFormat = new TemplateFormat { Template = "<a href=\"mailto:{0}\">{0}</a>" };
            this.dt.Columns[3].TemplateFormat = new NumberFormat { DecimalPlaces = 3, ThousandsSeparator = " " };
        }
    }
}
